#include "publics.h"
#include <QTime>
#include <QtCore>
#include <QApplication>
#include <QObject>

Publics::Publics()
{

}

QString Publics::randomNumber()
{
    QString ret = "0";
    QSqlQuery *query = new QSqlQuery("SELECT * FROM IDs", db);
    while (query->next())
    {
        ret = query->value(1).toString();
    }
    int yyy = ret.toInt() + 1;
     QSqlQuery *query2 = new QSqlQuery(QObject::tr("INSERT INTO IDs (LastNumber) VALUES ('%1')").arg(yyy));
     query2->clear();
    return ret;
}

